using System;
using System.Collections.Generic;
using System.Text;

using System.Data;
using System.Data.OleDb;

namespace SqlToolkit.Oracle.Schema
{
    public class SqlDbTableFieldCollection :SqlToolkit.SqlDataObjectCollectionBase
    {
        #region Construction
        public SqlDbTableFieldCollection() { }
        #endregion
        #region Add
        public int Add(SqlDbTableField value)
        {
            return base.Add(value);
        }
        #endregion
        #region IndexOf
        public int IndexOf(SqlDbTableField value)
        {
            return base.IndexOf(value);
        }
        #endregion
        #region Insert
        public void Insert(int index, SqlDbTableField value)
        {
            base.Insert(index, value);
        }
        #endregion
        #region Remove
        public void Remove(SqlDbTableField value)
        {
            base.Remove(value);
        }
        #endregion
        #region Indexer
        new public SqlDbTableField this[int index]
        {
            get { return (SqlDbTableField)base[index]; }
        }
        #endregion

        public SqlDbTableField FindByName(string name)
        {
            for (int i = 0; i < this.Count; i++)
            {
                if (this[i].ColumnName.Trim().ToUpper() == name.Trim().ToUpper())
                {
                    return this[i];
                }
            }

            return null;
        }

        public bool Contains(string name)
        {
            if (null != FindByName(name))
                return true;

            return false;
        }
    }
}
